package com.ys.homework;

/**
 * @author CodeYang
 * 3.创建一个空调，并调用制冷、制热、通风功能。空调包含的属性有品牌、匹数、温度，功能有加热、制冷、通风等功能。
 * @Date 2020/12/14 20:24
 */
public class 空调制冷07 {


    /*品牌*/
    String brand;
    /*匹数*/
    String hp;
    /*温度*/
    int temperature;

    public 空调制冷07() {

    }

    public 空调制冷07(String brand, String hp, int temperature) {

        this.brand = brand;
        this.hp = hp;
        this.temperature = temperature;
        this.print();
    }

    /**
     * 制冷
     */
    void refrigeration() {
        temperature -= 10;
        System.out.println("制冷:温度为:" + temperature);

    }

    /**
     * 制热
     */
    void heating(){
        temperature += 17;
        System.out.println("制冷:温度为:" + temperature);
    }

    /**
     * 通风
     */
    void ventilation(){
        System.out.println("通风中........");
        this.print();
    }
    void print(){
        System.out.println("brand = " + brand);
        System.out.println("hp = " + hp);
        System.out.println("temperature = " + temperature);

    }

    public static void main(String[] args) {
        空调制冷07 obj = new 空调制冷07("格力","12匹马力",22);
        obj.heating();
        obj.refrigeration();
        obj.ventilation();

    }
}
